<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>管理员</title>
</head>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Dashboard Template for Bootstrap</title>
    <!-- Bootstrap core CSS -->
    <link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
        table {
            width: 100%;
            height: 100%;
            border: 1px solid green;
            margin: auto;
            margin-top: 50px;
        }
    </style>
</head>

<body bgcolor="#ffdead">

<center><h1>全部票数</h1></center>
<!--引入抽取的topbar-->
<!--模板名：会使用thymeleaf的前后缀配置规则进行解析-->
<div align="right">
    <a href="/adticket">添加新票</a>
</div>
<div class="container-fluid" >
    <div class="row" >
        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <div class="table-responsive">
                <table class="table table-striped table-sm" style="text-align: center">
                    <thead>
                    <tr>
                        <th>演唱会名字</th>
                        <th>票价</th>
                        <th>余票数量</th>
                        <th>地点</th>
                        <th>演唱会开始时间</th>
                        <th>演唱会结束时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="emp:${ticket}">
                        <td th:text="${emp.getT_name()}"></td>
                        <td th:text="${emp.getT_price()}"></td>
                        <td th:text="${emp.getT_remaincount()}"></td>
                        <td th:text="${emp.getT_address()}"></td>
                        <td th:text="${emp.getT_date()+' '+emp.getT_starttime()}"></td>
                        <td th:text="${emp.getT_date()+' '+emp.getT_endtime()}"></td>
                        <td>
                            <!--用户名:<input name="username" type="text"/><br>
                            密码:<input name="password" type="password"> <br>
                            <input type="hidden" name="username" value="username"/>
                            <input type="submit" value="登录">-->
                            <form action="/addticket" method="post">
                                增添票数<input name="addcount" type="text"/>
                                <input type="hidden" name="t_id" th:value="${emp.getT_id()}"/>
                               <input type="submit" value="确认"></br>
                            </form>
                            <form action="/deleteticket" method="post">
                                减少票数<input name="deletecount" type="text"/>
                               <input type="hidden" name="t_id" th:value="${emp.getT_id()}"/>
                                <input type="submit" value="确认"><br>
                            </form>
                            <form action="/tdelete" method="post">
                                <input type="hidden" name="t_id" th:value="${emp.getT_id()}"/>
                                 <input type="submit" value="下架"><br>
                            </form>
                           <!-- <a class="btn btn-sm btn-primary" th:href="@{/buyticket(t_id=${emp.getPid()},username=${username},price=${emp.getPrice()})}">立即预定</a>
                            <a class="btn btn-sm btn-primary" th:href="@{/albumsdelete(name=${emp.getUserid()},id=${emp.getPid()})}">删除收藏</a>-->
                            <!--<a class="btn btn-sm btn-primary" th:href="@{/cancel(id=${orderdetail.getOrderId()})}">预订</a>
                            <a class="btn btn-sm btn-primary" th:href="@{/finish(id=${orderdetail.getOrderId()})}" >收藏</a>-->

                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </main>
        <form id="deleteEmpForm"  method="post">
            <input type="hidden" name="_method" value="delete"/>
        </form>
    </div>
</div>
</body>
</html>